package me.zk.practice1.hw;

import java.util.Scanner;

public class HWBJ06 {
    // 1 2 3 4 5
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.nextLine();
        String[] strs = s.split(",");
        int sum = 0;



        for (int i = 0; i <strs.length ; i++) {
            sum+= Integer.parseInt(strs[i]);
        }
        int l =0;
        for (int i = 1; i < strs.length; i++) {
            l += Integer.parseInt(strs[i-1]);
            if (l == (sum-Integer.parseInt(strs[i]) - l)) {
                System.out.println(i);
                return;
            }
        }
        System.out.println(-1);
    }
}
